package com.keti.controller;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.keti.Dao.RecordDao;
import com.keti.DaoImpl.RecordDaoImpl;
import com.keti.pojo.User;
import com.keti.pojo.record;


/**
 * Servlet implementation class RecordInterfaceServlet
 */
@WebServlet("/RecordInterfaceServlet")
public class RecordInterfaceServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int id = Integer.parseInt(request.getParameter("id"));
		RecordDao r = new RecordDaoImpl();
		List<record> list = new ArrayList<record>();
		list = r.querry(id);
		request.setAttribute("list", list);
		request.getRequestDispatcher("/jsp"
				+ "/RecordInterface.jsp").forward(request, response);
		
	}
	

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
